1. Field of the Invention
This invention relates generally to the field of computer systems and, more particularly, to power management in computer systems.
2. Description of the Related Art
As more functions have been added to computer systems in recent years, power consumption has become an important design issue. Many computer systems now have built-in functionality to put them into a xe2x80x9csleepxe2x80x9d mode after a certain amount of time elapses with no activity. However, many computer systems have a need for more advanced power management systems. This is especially true of portable computer systems and/or those that may operate on battery power.
When a typical computer system is put into a sleep mode, it is usually powered down in its entirety, saving the state of its processor and states of various other devices in a storage mechanism (such as a hard disk drive). Other more advanced power management techniques have been developed in order to allow a computer system to shut down specific parts of a system. One example would be a computer system which is designed to shut down a peripheral component interface (PCI) bus when the device or devices coupled to the bus are inactive. Such power management schemes may be very simple when a power-manageable resource such as a PCI bus has only one device coupled to it. However, when two or more independent devices share a power-manageable resource, power management schemes may be difficult to implement.
Power management in a shared resource such as a bus may be complicated by various factors. One such factor is the device drivers for the various devices that are coupled to the resource. Typically, a shared resource is independent of the various device drivers for those devices coupled to the resource. Prior to initiating suspension of power, the device driver for each device must read and store the state of that device and other housekeeping operations necessary for suspension of power. Once each device attached to the resource has completed the necessary suspend operations, the bus may be safely powered down. However, since the device drivers for each device operate independently of the bus, there is no communication mechanism to inform the bus hardware that all devices have completed the necessary suspend operations. Thus, with no communication mechanism, the bus hardware cannot determine whether it can safely powered down.
The problems outlined above are in large part solved by the use of the system and method for monitoring and controlling a power-manageable resource. In one embodiment, a power manageable resource, such as a bus in a computer system, may be shareable among a number of power-manageable devices. A resource monitor may also be coupled to the power-manageable resource. The resource monitor may be configured to monitor the devices coupled to the power manageable resource. More specifically, the functions of the resource monitor may include monitoring the active/inactive state of each of the attached devices. The resource monitor may be configured to cause the sharable resource to be powered down if it is determined that all the attached devices are in an inactive state.
In one embodiment, the power-manageable resource is a timeslot bus, configured to transmit data in frames. Each frame may include a plurality of status bits, and each of these status bits may correspond to one of the devices attached to the bus. Each status bit may be used to indicate the active/inactive status of the corresponding device. A resource monitor may be configured to monitor the status bits, and may cause the bus (and all attached devices) to be powered down responsive to determining that all devices are inactive.
In another embodiment, the bus may be a packet bus, and may be configured to periodically transmit idle frames, with each frame including a plurality of status bits. These status bits may correspond to devices attached to the bus, and may indicate the active/inactive status of each of the devices. A resource monitor may be configured to monitor the active/inactive status bits of each device. Alternatively, each of the devices coupled to the packet bus may be configured to transmit an activate packet responsive to becoming active, and a deactivate packet responsive to becoming inactive. The resource monitor may be used to track the active/inactive state of each of the devices attached to the bus. In one embodiment, the resource monitor may include a counter that is incremented each time a device sends an activate packet, and decremented when a device transmits a deactivate packet. The resource monitor may then power down the bus if the counter value reaches zero, indicating that all devices on the bus are inactive.
In still another embodiment, a plurality of registers may be used for indicating the active/inactive status of devices attached to a power-manageable resource, such as a bus. Each register may correspond to one of the attached devices. Each register may be updated responsive to its corresponding device becoming active or inactive. The registers corresponding to each device may be centrally located in a resource monitor in some embodiments. Alternatively, the registers corresponding to each device may be located within the device itself in other embodiments. In either case, the resource monitor may track the active/inactive state of each device by reading the registers, and may power down the bus when all devices have been determined to be inactive.
Thus, in various embodiments, the system and method for monitoring and controlling a power-manageable resource may allow a bus or other resource to be powered down when not in use. By monitoring each device attached to the resource, a resource monitor may be able to determine when it is in an idle state. Furthermore, the monitoring of each attached device may allow each of the devices to complete all necessary operations prior to powering down. This may allow the devices to be powered down in a clean and safe manner.